# -*- encoding:utf-8 -*-
# !/usr/bin/env python
'''
    python-0811-02.py
    ======================
    @descript: 单例设计模式
    @copyright:nnz
    @author:dln
    @date: 2021/8/11 17:25
    @version:v1.0
'''
class A:
    cls_01=None
    _flag=False
    def __new__(cls, *args, **kwargs):
        if cls.cls_01 is None:
            cls.cls_01=object.__new__(cls)
            pass
        return cls.cls_01
    pass
def __init__(self,p1,p2):
    if not A._flag:
        self.v_01=p1
        self.v_02=p2
        A._flag=True
        pass
    pass
pass
v_object01=A(1,3)
v_object02=A(1,2)
if v_object01 is v_object02:
    print('对象相同')
else:
    print('对象不同')
